//
//  CommonTools.swift
//  WYWeibo
//
//  Created by wangyi on 16/7/12.
//  Copyright © 2016年 wangyi. All rights reserved.
//

import UIKit
//切换跟控制器通知名
let SwitchRootVCNotification = "SwitchRootVCNotification"
//点击表情按钮发送的通知名
let DidSelectedEmotionbuttonNotification = "DidSelectedEmotionbuttonNotification"
//点击删除按钮发送通知名
let DidBUttonDeleteTextViewtextNotification = "DidBUttonDeleteTextViewtextNotification"
//当前屏幕宽度
let ScreenWidth = UIScreen.mainScreen().bounds.size.width
//当前屏幕高度
let Screenheight = UIScreen.mainScreen().bounds.size.height

//抽取一个随机色
func RGB(red: CGFloat, green: CGFloat, blue: CGFloat ) -> UIColor {

    return UIColor(red: red, green: green, blue: blue, alpha: 1)
}

func RandomColor() -> UIColor {

    let red = random() % 256
    let green = random() % 256
    let blue = random() % 256
   return RGB(CGFloat(red) / 255, green: CGFloat(green) / 255, blue: CGFloat(blue) / 255)
}
//如果函数参数提供默认值 可以省略不传入这个参数
func printLog(title: Any, file: String = __FILE__, funName: String = __FUNCTION__, line: Int = __LINE__) {
    
    #if DEBUG
    
    print("\((file as NSString).lastPathComponent)[\(line)], \(funName)")
    
    #endif
    
}
